home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.MovieClip;
- import flash.events.Event;
-
- public class DragonChar extends MovieClip
- {
-
-
- internal const DRAGONMAXFIRE:* = 4;
-
- private var §\x01\x01\n\x03§:int = 10000;
-
- private var §\x01\x01\n\x04§:Array;
-
- internal const DOC_HEIGHT:* = 400;
-
- private var theKnight:* = null;
-
- private var §\x01\x01\n\x07§:int = 0;
-
- private var §\x01\x01\n\b§:int = 0;
-
- internal const DRAGONATTACKBLAST:* = 1;
-
- internal const HEALTHDAMAGE:* = 50;
-
- internal const DOC_LEFT:* = 0;
-
- internal const DRAGONATTACKFIRE:* = 3;
-
- internal const FIREINITX:* = 650;
-
- internal const FIREINITY:* = 95;
-
- private var §\x01\x01\x02\t§:* = null;
-
- internal const DRAGONATTACKUPPER:* = 2;
-
- private var §\x01\x01\n\r§:Number;
-
- private var §\x01\x01\n\x0e§:Number;
-
- internal const ARMORDAMAGE:* = 30;
-
- public var burstfire:MovieClip;
-
- private var §\x01\x01\x06\r§:* = null;
-
- public var §\x01\x01\n\x10§:* = null;
-
- public var §\x01\x01\x0b\x01§:* = null;
-
- public var §\x01\x01\x0b\x02§:* = null;
-
- internal const DOC_TOP:* = 0;
-
- internal const DOC_QUARTI:* = 160;
-
- internal const DRAGONATTACKBITE:* = 4;
-
- internal const DRAGONINITDELAY:* = 10000;
-
- private var §\x01\x01\x0b\x03§:int = 0;
-
- private var §\x01\x01\x0b\x04§:int = 0;
-
- internal const DRAGONATTACKSPACE:* = 100;
-
- public var §\x01\x01\x0b\x05§:* = null;
-
- private var §\x01\x01\x04\x0e§:Boolean;
-
- internal const DOC_WIDTH:* = 640;
-
- private var §\x01\x01\x0b\x06§:int = 0;
-
- internal const DRAGONHIDE:* = 0;
-
- internal const DRAGONDELAYDECR:* = 50;
-
- private var §\x01\x01\x0b\x07§:int = 0;
-
- internal const DOC_MIDH:* = 320;
-
- internal const DOC_QUARTII:* = DOC_MIDH + DOC_QUARTI;
-
- internal const DOC_MIDV:* = 200;
-
- public function DragonChar()
- {
- §\x01\x01\n\x03§ = DRAGONINITDELAY;
- §\x01\x01\x0b\x04§ = 0;
- §\x01\x01\x0b\x06§ = 0;
- §\x01\x01\x02\t§ = null;
- §\x01\x01\x06\r§ = null;
- theKnight = null;
- §\x01\x01\x0b\x07§ = 0;
- §\x01\x01\n\b§ = 0;
- §\x01\x01\x0b\x03§ = 0;
- §\x01\x01\n\x04§ = new Array();
- §\x01\x01\n\x10§ = null;
- §\x01\x01\x0b\x01§ = null;
- §\x01\x01\x0b\x05§ = null;
- §\x01\x01\x0b\x02§ = null;
- §\x01\x01\n\x07§ = 0;
- super();
- }
-
- public function §\x01\x01\n\x02§(param1:*) : *
- {
- §\x01\x01\x0b\x03§ = param1;
- }
-
- public function GetDragonStatus() : int
- {
- return §\x01\x01\x0b\x07§;
- }
-
- private function §\x01\x01\n\x05§() : Boolean
- {
- if(§\x01\x01\x0b\x06§ <= 0)
- {
- §\x01\x01\x0b\x06§ = Math.round((Math.random() * §\x01\x01\n\x03§ + §\x01\x01\n\x03§) / 42);
- §\x01\x01\n\x03§ -= DRAGONDELAYDECR;
- return true;
- }
- --§\x01\x01\x0b\x06§;
- return false;
- }
-
- public function §\x01\x01\n\x06§(param1:int) : *
- {
- if(theKnight.Health > 0)
- {
- switch(param1)
- {
- case DRAGONHIDE:
- if(§\x01\x01\x0b\x07§ != DRAGONATTACKBITE)
- {
- §\x01\x01\x0b\x07§ = DRAGONHIDE;
- §\x01\x01\n\b§ = §\x01\x01\x0b\x07§;
- gotoAndStop(1);
- }
- else
- {
- §\x01\x01\x0b\x07§ = DRAGONHIDE;
- §\x01\x01\n\b§ = §\x01\x01\x0b\x07§;
- gotoAndPlay("bitehide");
- }
- break;
- case DRAGONATTACKBLAST:
- §\x01\x01\x0b\x07§ = DRAGONATTACKBLAST;
- gotoAndPlay("blast");
- break;
- case DRAGONATTACKUPPER:
- §\x01\x01\x0b\x07§ = DRAGONATTACKUPPER;
- gotoAndPlay("burst");
- break;
- case DRAGONATTACKFIRE:
- §\x01\x01\x0b\x07§ = DRAGONATTACKFIRE;
- gotoAndPlay("fire");
- break;
- case DRAGONATTACKBITE:
- if(§\x01\x01\x0b\x07§ != DRAGONATTACKBITE)
- {
- §\x01\x01\x0b\x07§ = DRAGONATTACKBITE;
- gotoAndPlay("bite");
- }
- else
- {
- §\x01\x01\x0b\x07§ = DRAGONATTACKBITE;
- gotoAndPlay("biting");
- }
- break;
- default:
- §\x01\x01\x0b\x07§ = DRAGONHIDE;
- gotoAndStop(1);
- }
- }
- }
-
- public function GetArmorDamage() : int
- {
- if(this.currentLabel == "biting")
- {
- return ARMORDAMAGE;
- }
- if(this.currentLabel == "blasting")
- {
- return ARMORDAMAGE * 0.5;
- }
- return 0;
- }
-
- private function §\x01\x01\n\t§(param1:Event) : *
- {
- if(theKnight.Health > 0)
- {
- switch(§\x01\x01\x0b\x07§)
- {
- case DRAGONHIDE:
- if(theKnight.x <= DOC_QUARTI && Math.random() > 0.9)
- {
- §\x01\x01\n\x06§(DRAGONATTACKBITE);
- }
- if(§\x01\x01\n\x05§())
- {
- §\x01\x01\n\x06§(§\x01\x01\n\n§());
- §\x01\x01\n\x03§ -= 100;
- }
- }
- if(this.currentLabel == "hide")
- {
- §\x01\x01\n\b§ = 0;
- §\x01\x01\x0b\x07§ = DRAGONHIDE;
- }
- else if(this.currentLabel == "stopburst")
- {
- §\x01\x01\n\b§ = 0;
- if(§\x01\x01\x0b\x03§ > 1)
- {
- this.x += 50;
- gotoAndPlay("burst");
- --§\x01\x01\x0b\x03§;
- }
- else
- {
- this.x = §\x01\x01\n\r§;
- gotoAndStop("hide");
- }
- }
- else if(this.currentLabel == "firing1")
- {
- §\x01\x01\x0b\b§(1);
- play();
- }
- else if(this.currentLabel == "firing2")
- {
- if(§\x01\x01\x0b\x03§ >= 2)
- {
- §\x01\x01\x0b\b§(2);
- play();
- }
- else
- {
- gotoAndStop("firing1");
- }
- }
- else if(this.currentLabel == "firing3")
- {
- if(§\x01\x01\x0b\x03§ >= 3)
- {
- §\x01\x01\x0b\b§(3);
- play();
- }
- else
- {
- gotoAndStop("firing2");
- }
- }
- else if(this.currentLabel == "firing4")
- {
- if(§\x01\x01\x0b\x03§ >= 4)
- {
- §\x01\x01\x0b\b§(4);
- play();
- }
- else
- {
- gotoAndStop("firing3");
- }
- }
- else if(this.currentLabel == "biting" || this.currentLabel == "bursting" || this.currentLabel == "blasting")
- {
- if(§\x01\x01\x0b\x07§ != §\x01\x01\n\b§)
- {
- §\x01\x01\n\x0b§();
- §\x01\x01\n\b§ = §\x01\x01\x0b\x07§;
- }
- }
- }
- }
-
- public function DeactivateFire(param1:*) : *
- {
- if(param1 == 1)
- {
- §\x01\x01\n\x10§.x = FIREINITX;
- §\x01\x01\n\x10§.gotoAndStop(1);
- }
- else if(param1 == 2)
- {
- §\x01\x01\x0b\x01§.x = FIREINITX;
- §\x01\x01\x0b\x01§.gotoAndStop(1);
- }
- else if(param1 == 3)
- {
- §\x01\x01\x0b\x05§.x = FIREINITX;
- §\x01\x01\x0b\x05§.gotoAndStop(1);
- }
- else if(param1 == 4)
- {
- §\x01\x01\x0b\x02§.x = FIREINITX;
- §\x01\x01\x0b\x02§.gotoAndStop(1);
- }
- }
-
- private function §\x01\x01\n\n§() : int
- {
- var _loc1_:int = 0;
- _loc1_ = 0;
- if(theKnight.x > DOC_QUARTI && theKnight.x <= DOC_MIDH)
- {
- if(_loc1_ < 5)
- {
- §\x01\x01\n\x02§(2);
- }
- else if(_loc1_ < 7)
- {
- §\x01\x01\n\x02§(3);
- }
- else if(_loc1_ < 9)
- {
- §\x01\x01\n\x02§(4);
- }
- else
- {
- §\x01\x01\n\x02§(1);
- }
- return DRAGONATTACKFIRE;
- }
- if(theKnight.x > DOC_MIDH && theKnight.x <= DOC_QUARTII)
- {
- return DRAGONATTACKBLAST;
- }
- if(theKnight.x > DOC_QUARTII)
- {
- _loc1_ = Math.random() * 10;
- if(_loc1_ < 5)
- {
- §\x01\x01\n\x02§(2);
- }
- else if(_loc1_ < 7)
- {
- §\x01\x01\n\x02§(3);
- }
- else if(_loc1_ < 9)
- {
- §\x01\x01\n\x02§(4);
- }
- else
- {
- §\x01\x01\n\x02§(1);
- }
- return DRAGONATTACKUPPER;
- }
- return 0;
- }
-
- public function GetCharType() : String
- {
- return "dragon";
- }
-
- private function §\x01\x01\n\x0b§() : Boolean
- {
- if(this.hitTestObject(theKnight.hitdetector))
- {
- if(§\x01\x01\x0b\x07§ == DRAGONATTACKUPPER)
- {
- theKnight.DragonAttack(HEALTHDAMAGE * 0.5,ARMORDAMAGE * 0.5);
- }
- else
- {
- theKnight.DragonAttack(HEALTHDAMAGE,ARMORDAMAGE);
- }
- return true;
- }
- return false;
- }
-
- public function Init(param1:*, param2:*, param3:*) : *
- {
- §\x01\x01\x02\t§ = param1;
- §\x01\x01\x06\r§ = param2;
- theKnight = param3.theKnight;
- §\x01\x01\n\r§ = this.x;
- §\x01\x01\n\x0e§ = this.y;
- §\x01\x01\n\x0f§();
- §\x01\x01\n\x03§ = DRAGONINITDELAY;
- §\x01\x01\x0b\x06§ = Math.round((Math.random() * §\x01\x01\n\x03§ + §\x01\x01\n\x03§) / 42);
- §\x01\x01\n\x06§(DRAGONHIDE);
- §\x01\x01\x02\t§.addEventListener(Event.ENTER_FRAME,§\x01\x01\n\t§,false,0,true);
- }
-
- private function §\x01\x01\n\f§() : *
- {
- if(§\x01\x01\n\x10§ == null)
- {
- §\x01\x01\x06\r§.removeChild(§\x01\x01\n\x10§);
- §\x01\x01\n\x10§ = null;
- }
- if(§\x01\x01\x0b\x01§ == null)
- {
- §\x01\x01\x06\r§.removeChild(§\x01\x01\x0b\x01§);
- §\x01\x01\x0b\x01§ = null;
- }
- if(§\x01\x01\x0b\x05§ == null)
- {
- §\x01\x01\x06\r§.removeChild(§\x01\x01\x0b\x05§);
- §\x01\x01\x0b\x05§ = null;
- }
- if(§\x01\x01\x0b\x02§ == null)
- {
- §\x01\x01\x06\r§.removeChild(§\x01\x01\x0b\x02§);
- §\x01\x01\x0b\x02§ = null;
- }
- }
-
- public function GetHealthDamage() : int
- {
- if(this.currentLabel == "biting")
- {
- return HEALTHDAMAGE;
- }
- if(this.currentLabel == "blasting")
- {
- return HEALTHDAMAGE * 0.75;
- }
- return 0;
- }
-
- private function §\x01\x01\n\x0f§() : *
- {
- if(§\x01\x01\n\x10§ == null)
- {
- §\x01\x01\n\x10§ = new fireball();
- §\x01\x01\n\x10§.x = FIREINITX;
- §\x01\x01\n\x10§.y = FIREINITY;
- §\x01\x01\n\x10§.Init(§\x01\x01\x02\t§,§\x01\x01\x06\r§,this,1);
- §\x01\x01\x06\r§.addChild(§\x01\x01\n\x10§);
- DeactivateFire(1);
- }
- if(§\x01\x01\x0b\x01§ == null)
- {
- §\x01\x01\x0b\x01§ = new fireball();
- §\x01\x01\x0b\x01§.x = FIREINITX;
- §\x01\x01\x0b\x01§.y = FIREINITY;
- §\x01\x01\x0b\x01§.Init(§\x01\x01\x02\t§,§\x01\x01\x06\r§,this,2);
- §\x01\x01\x06\r§.addChild(§\x01\x01\x0b\x01§);
- DeactivateFire(2);
- }
- if(§\x01\x01\x0b\x05§ == null)
- {
- §\x01\x01\x0b\x05§ = new fireball();
- §\x01\x01\x0b\x05§.x = FIREINITX;
- §\x01\x01\x0b\x05§.y = FIREINITY;
- §\x01\x01\x0b\x05§.Init(§\x01\x01\x02\t§,§\x01\x01\x06\r§,this,3);
- §\x01\x01\x06\r§.addChild(§\x01\x01\x0b\x05§);
- DeactivateFire(3);
- }
- if(§\x01\x01\x0b\x02§ == null)
- {
- §\x01\x01\x0b\x02§ = new fireball();
- §\x01\x01\x0b\x02§.x = FIREINITX;
- §\x01\x01\x0b\x02§.y = FIREINITY;
- §\x01\x01\x0b\x02§.Init(§\x01\x01\x02\t§,§\x01\x01\x06\r§,this,4);
- §\x01\x01\x06\r§.addChild(§\x01\x01\x0b\x02§);
- DeactivateFire(4);
- }
- }
-
- public function Destroy() : *
- {
- §\x01\x01\n\f§();
- §\x01\x01\x02\t§.removeEventListener(Event.ENTER_FRAME,§\x01\x01\n\t§);
- }
-
- private function §\x01\x01\x0b\b§(param1:int) : *
- {
- if(§\x01\x01\x0b\x03§ >= param1)
- {
- if(param1 == 1)
- {
- §\x01\x01\n\x10§.gotoAndPlay(1);
- §\x01\x01\n\x10§.Activate();
- }
- else if(param1 == 2)
- {
- §\x01\x01\x0b\x01§.gotoAndPlay(1);
- §\x01\x01\x0b\x01§.Activate();
- }
- else if(param1 == 3)
- {
- §\x01\x01\x0b\x05§.gotoAndPlay(1);
- §\x01\x01\x0b\x05§.Activate();
- }
- else if(param1 == 4)
- {
- §\x01\x01\x0b\x02§.gotoAndPlay(1);
- §\x01\x01\x0b\x02§.Activate();
- }
- }
- }
- }
- }
-